//////////////////////////////////////////////////////////////////////
// 
//	File: FunctionGraph.h
// 
//	Graphics and Imaging Lab
//	Dept. of Computer Scinece and Engineering
//	University of Washington
//
// 
//	Created:       Tue Jun 08 16:45 2004 by C. Karen Liu
//	
//	FunctionGraph is a general function data type that evaluates itsef
//	for display
//////////////////////////////////////////////////////////////////////

#ifndef __FUNCTIONGRAPH_H__
#define __FUNCTIONGRAPH_H__

#include "vl/VLd.h"
#include <vector>

class FunctionGraph
{
	public:
		enum FUNCINDEX { DOFS, MUSCLES, CONTACTFORCEX, CONTACTFORCEY, CONTACTFORCEZ, CONTACTPOSX, CONTACTPOSY, CONTACTPOSZ, HANDLEPOSX, HANDLEPOSY, HANDLEPOSZ, COMX, COMY, COMZ, COMVELX, COMVELY, COMVELZ, COMACCELX, COMACCELY, COMACCELZ, ORIENTATIONX, ORIENTATIONY, ORIENTATIONZ};
		enum FUNCTYPE { DOF, NODE, HANDLE };
	protected:
		FUNCTYPE mType;
		FUNCINDEX mIndex;
		Matd mEvaluatedData;

		int mFrameNum;
	public:
		FunctionGraph(FUNCINDEX index, FUNCTYPE type):mType(type), mIndex(index){}

		virtual ~FunctionGraph(){}

		virtual void evalData( vector<vector<double> >& _data) = 0;
		virtual void getData(std::vector<int>& _indecies, std::vector< Vecd >& _data){
			int nIndex = static_cast<int>(_indecies.size());
			for(int i = 0; i < nIndex; i++)
				_data.push_back(mEvaluatedData[_indecies[i]]);				
		}

		inline FUNCINDEX getIndex(){ return mIndex; }
		inline FUNCTYPE getType(){ return mType; }
};

#endif	// __FUNCTIONGRAPH_H__

